from django.contrib import admin
from .models import Tag, Author, Article, Classification
# Register your models here.
class AuthorAdmin(admin.ModelAdmin):
    list_display = ('name', 'email', 'website')
    search_fields = ('name',)

class ArticleAdmin(admin.ModelAdmin):
    list_display = ('caption', 'slug', 'classification', 'author' ,'publish_time','update_time')
    list_filter = ('publish_time',)
    date_hierarchy = 'publish_time'
    ordering = ('-publish_time',)
    filter_horizontal = ('tags',)

class ClassificationAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug',)
 
 
class TagAdmin(admin.ModelAdmin):
    list_display = ('tag_name', 'slug')

admin.site.register(Article, ArticleAdmin)
admin.site.register(Author, AuthorAdmin)
admin.site.register(Tag,TagAdmin)
admin.site.register(Classification,ClassificationAdmin)


